package Stream;

/*
 * Author: JacksonCoder
 * FileName: first
 * Version: 1.0.0
 * Date: 2025/7/8
 */

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public class first {

    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, 3);

        List<Integer> result = list.stream().
                filter(integer -> integer > 1).
                collect(Collectors.toList());
        System.out.println(result);

        List<String> Strs = Arrays.asList("alice", "alen", "bob", "tom");
        List<String> result2 = Strs.stream().
                filter(str -> str.startsWith("a")).
                collect(Collectors.toList());
        System.out.println("result2 :" + result2);
    }

}
